﻿
using System.Configuration;
using Microsoft.ApplicationBlocks.Data;

namespace VoteEventService
{
    internal class DAL
    {
        protected static readonly string Conn = ConfigurationManager.AppSettings["EventConnectionString"];

        internal static void Vote_Update(int id, int round)
        {
            SqlHelper.ExecuteScalar(Conn, "service_Vote_Update", id, round);
        }

        internal static void VoteLog_Insert(VoteLogObject o)
        {
            SqlHelper.ExecuteScalar(Conn, "service_VoteLog_Insert", o.VoteLog_FromID
                                    , o.VoteLog_FromName
                                    , o.VoteLog_FromEmail
                                    , o.VoteLog_ToID
                                    , o.VoteLog_ToName
                                    , o.VoteLog_ToEmail
                                    , o.VoteLog_Time
                                    , o.VoteLog_XForwardedFor
                                    , o.VoteLog_HttpForwardedFor
                                    , o.VoteLog_RemoteAddr
                                    , o.VoteLog_Round);
        }
    }
}
